﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using QuanLyHocBongSinhVien.DAO;
using QuanLyHocBongSinhVien.VO;

namespace QuanLyHocBongSinhVien.Bus
{
    class ChiTiet_Bus
    {
        ChiTiet_DAO ct=new ChiTiet_DAO();
        List<ChiTiet_VO> list = new List<ChiTiet_VO>();

        public List<ChiTiet_VO> getAllChiTiet()
        {
            DataTable dt = new DataTable();
            List<ChiTiet_VO> l = new List<ChiTiet_VO>();
            foreach (DataRow r in dt.Rows)
            {
                ChiTiet_VO ctiet = new ChiTiet_VO();
                ctiet.MaHB = r[0].ToString();
                ctiet.MaMHB = r[1].ToString();
                ctiet.MaSV = r[2].ToString();
                ctiet.SoTien = (int)r[3];
                ctiet.ThoiGian = (DateTime)r[4];
            }
            return l;
        }


        public DataTable GetAllChiTiet()
        {
            return ct.getAllChiTiet();
        }

        public void Add(string mhb, string mmhb, string msv, int st, DateTime tg)
        {
            ct.ThemCT(mhb, mmhb, msv, st, tg);

        }
        public void Update(string mhb, string mmhb, string msv, int st, DateTime tg)
        {
            ct.SuaCT(mhb, mmhb, msv,st,tg);
        }

        public void Delete(string mhb, string mmhb, string msv)
        {
            ct.XoaCT(mhb, mmhb, msv);
        }

        public void TkTheoMaHB(string mhb)
        {
            ct.Tk_MaHB(mhb);
        }

        public void TkTheoMaMucHB(string mmhb)
        {
            ct.Tk_MaMucHB(mmhb);
        }
        public void TkTheoMaSV(string msv)
        {
            ct.Tk_MaSV(msv);
        }
        public void TkTheoSoTien(int st)
        {
            ct.Tk_SoTien(st);
        }

        public void TkTheoTG(DateTime tg)
        {
            ct.Tk_ThoiGian(tg);
        }
    }
}
